package com.xcyy.clbzbh.common;

import com.xcyy.clbzbh.VO.ResultVO;

public  class ResultVOUtil {
    public static ResultVO success(Object object){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        return resultVO;
    }
    public static  ResultVO success(){
        return success(null);
    }
    public static ResultVO successforPage(Object object, Integer totalPage){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        resultVO.setTotalPage(totalPage);
        return resultVO;
    }
    public static ResultVO successforCount(Object object, Long count){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(object);
        resultVO.setCount(count);
        return resultVO;
    }
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO =new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
